﻿using System;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FwProject.Core.Restaurant;
using FwProject.Core.Car;
using FwProject.Core.TypeNumber;

namespace FwProject.Core.Distribution
{
    /// <summary>
    /// 配送明细
    /// </summary>
    [Table("DistributionInfoDetails")]
    public class DistributionInfoDetails : FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 餐厅编号
        /// </summary>
        /// <value>The restaurantid.</value>
        [Required]
        public Guid Restaurantid { get; set; }

        [ForeignKey("Restaurantid")]
        public virtual RestaurantInfo RestaurantInfoModel { get; set; }
        /// <summary>
        /// 产品型号
        /// </summary>
        /// <value>The restaurantid.</value>
        public Guid? RestaurantTypenNumberInfoId { get; set; }

        [ForeignKey("RestaurantTypenNumberInfoId")]
        public virtual RestaurantTypenNumberInfo RestaurantTypenNumberInfoModel { get; set; }

        /// <summary>
        /// 本次配送箱数
        /// </summary>
        /// <value>The distributioncount.</value>
        [Required]
        public int Distributioncount { get; set; } = 0;
        /// <summary>
        /// 回收
        /// </summary>
        /// <value>The recoverycount.</value>
        [Required]
        public int Recoverycount { get; set; } = 0;
        /// <summary>
        /// 换货
        /// </summary>
        /// <value>The exchangegoodscount.</value>
        [Required]
        public int Exchangegoodscount { get; set; } = 0;
        /// <summary>
        /// 折损
        /// </summary>
        /// <value>The damagecount.</value>
        [Required]
        public int Damagecount { get; set; } = 0;
        /// <summary>
        /// 赠送
        /// </summary>
        /// <value>The givecount.</value>
        [Required]
        public int Givecount { get; set; } = 0;
        /// <summary>
        /// 退箱
        /// </summary>
        /// <value>The backboxcount.</value>
        [Required]
        public int Backboxcount { get; set; } = 0;
        /// <summary>
        /// 退数
        /// </summary>
        /// <value>The backnumbercount.</value>
        [Required]
        public int Backnumbercount { get; set; } = 0;
        /// <summary>
        /// 型号名称
        /// </summary>
        public string TypeNumberName { get; set; }

        public Guid? TypeNumberInfoId { get; set; }
        [ForeignKey("TypeNumberInfoId")]

        public virtual TypeNumberInfo TypeNumberInfoModel { get; set; }
        /// <summary>
        /// 型号单价
        /// </summary>
        public decimal TypeNumberPrice { get; set; } = 0;

        public Guid? DistributionInfoId { get; set; }
        [ForeignKey("DistributionInfoId")]
        public virtual DistributionInfo DistributionInfoModel { get; set; }
    
        /// <summary>
        /// 支付状态
        /// </summary>
        /// <value>The pricestatus.</value>
        [Required]
        public Pricestatus Pricestatus { get; set; } = Pricestatus.未结账;
        /// <summary>
        /// 应支付金额
        /// </summary>
        /// <value>The price.</value>
        [Required]
        public decimal Sumprice { get; set; } = 0;

     
        /// <summary>
        /// 结账编码
        /// </summary>
        /// <value>The prices identifier.</value>
        public Guid PricesId { get; set; }
    }

}
